package kr.saeildamil.androidStudy_second.valueani;

import kr.saeildamil.androidStudy_second.R;
import kr.saeildamil.androidStudy_second.R.id;
import kr.saeildamil.androidStudy_second.R.layout;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ValueAnimationTest1 extends Activity {
	Button mBtn;

	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch24_valueanimator);
		mBtn = (Button) findViewById(R.id.ch24_valueani_btn);
	}

	public void mOnClick(View v) {
		ValueAnimator Valanim = ValueAnimator.ofInt(150, 480);
		Valanim.setDuration(2000);
		Valanim.addUpdateListener(new AnimatorUpdateListener() {
			public void onAnimationUpdate(ValueAnimator animation) {
				mBtn.setWidth((Integer) animation.getAnimatedValue());
			}
		});
		Valanim.start();
	}
}
